<%@ page language="java" contentType="text/html; charset=UTF-8"
	isErrorPage="true" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<% 
String wrongLogin = request.getParameter("wrongLogin");
%>
<html>

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>IT运维管理平台</title>
<link rel="shortcut icon" href="favicon.ico">
<!--<link href="hplus/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="hplus/css/font-awesome.css?v=4.4.0" rel="stylesheet">

<link href="hplus/css/animate.css" rel="stylesheet">
<link href="hplus/css/style.css?v=4.1.0" rel="stylesheet">-->
<link href="styles/login.css" rel="stylesheet">


</head>
<div class="login_body">
	<div class="login_bg">
		<div class="login_logdiv">
			<div class="login_titlefont"></div>
			<form id="myForm">
				<div class="login_group">
					<label class="login_label" for="username">用&nbsp;户&nbsp;名</label>
					<input class="login_input" type="text" name="login_name" id="username" autocomplete="off"  />
				</div>
				<div class="login_group">
					<label class="login_label" for="password">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码</label>
					<input class="login_input" type="password" name="password" id="password" autocomplete="off"  />
				</div>
				<div class="login_btngroup">
					<button type="button" class="login_submitbtn" onclick='sumbit()'>登&nbsp;&nbsp;&nbsp;录</button>
				</div>
			</form>
		</div>
	</div>
</div>
	
	<!-- 全局js -->
	<!-- <script src="hplus/js/jquery.min.js?v=2.1.4"></script>
	<script src="hplus/js/bootstrap.min.js?v=3.3.6"></script> -->
	<script type="text/javascript" src="easyui/jquery.min.js"></script>
	<script type="text/javascript"src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
	var  sumbit =function() {
		if (document.getElementById("username").value == ""
				|| document.getElementById("password").value == "") {
			alert("用户名或密码不能为空！");
			return false;
		}else{
			var login_name = $("#username").val();
			var password = $("#password").val();
			/* console.log(password) */
			$.ajax({
				type:"POST",
				url:"login/check",
				data:{login_name:login_name,password:password},
				dataType:"Json",
				success:function(res){
					var info = res.info;
					if(info=="admin"){
						window.location.href = "index.html"
					}else if(info=="success"){
						window.location.href = "html/user_validate.html"
					}else{
						alert("账号或者密码错误")
					}
				}
			});
		}
	}
	
	var num = "1"
	//判断页面是否有session
	$.ajax({
			type:"post",
			url : "User/getUser",//路径 
		    contentType : "application/json;charset=UTF-8",
		    data:{num:num},
		    dataType:"Json",
		    async:true,
		    success : function(res){
		    	console.log(res)
		    }
		})
	
	
</script>
</body>

</html>
